package com.example.demo.mapper;

import com.example.demo.entity.Code;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    //查询所有用户
    List<User> selectAllUser(@Param("username") String username,@Param("uid") int uid);

    //新增用户
    int addUser(User user);

    //删除用户
    int deleteUser(int uid);

    //重置密码
    int resetPsd(@Param("psd") String psd, @Param("account") String account);

    //通过uid得到账号
    String selectAccount(int uid);

    //忘记密码
    User forgetPsd(@Param("account") String account,@Param("phone")String phone);

    //修改用户状态
    int updateUserType(@Param("type") String type,@Param("uid") int uid);

    //查询用户是或否存在
    User selectUserEx(String account);

    //插入验证码
    int insertCode(String code);

    //查询验证码
    Code selectCode(String code);

    //删除验证码
    int deleteCode(String code);

    User selectById(int uid);
}

